home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
dlx70bbs.zip
/
DLX70SRC.ZIP
/
SCRIPT3.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-01-26
|
24KB
|
570 lines
{$debug-}
{$line-}
{$include: 'types.int'}
{$include: 'globals.int'}
{$include: 'utils.int'}
{$include: 'funs.int'}
{$include: 'fs_pkg.int'}
{$include: 'database.int'}
{$include: 'load.int'}
{$include: 'sutils.int'}
{$include: 'script3.int'}
IMPLEMENTATION OF script3;
USES types,globals,utils,funs,fs_pkg,database,load,sutils;
{DLX Bulletin Board System V7.0
FREEWARE NOTICE
DLX V7.0 is placed in the public domain by its author, Richard Gillmann.
Anyone who wishes to may run the program, copy it, or modify it for
any purpose, including commercial gain.}
{***Interface to the PASASM assembler utilities package***}
{$include: 'pasasm.int'}
procedure bbs3{consts s : lstring; var str : lstring};
var
i,j,k : integer;
i4,j4 : integer4;
next_state : task;
p : para;
h : mailhead;
fl : boolean;
begin
next_state:=succ(q[wx].state);
case q[wx].state of
userlog:
[if (q[wx].count<userlog_entries) and then
((q[wx].index<>userlog_next) or (q[wx].count=0)) then
[q[wx].count:=q[wx].count+1; q[wx].index:=q[wx].index-1;
if q[wx].index<=0 then q[wx].index:=userlog_entries;
dbg_userlog(q[wx].index,userlog_buffer);
if ivalue(userlog_buffer.userlevel)>=priv_log then
display(userlog_line_txt)
else
[if disk2u(ivalue(userlog_buffer.userid)) and then
ivalue(q[wx].your.userlevel)>=priv_log
then display(userlog_line_txt)];
next_state:=userlog]
else
next_state:=main_menu];
sendmail_prompt: prompt_with(file_number_txt);
sendmail_to:
[make_number(s,str);
if number_query(str,1,largest_member_number,i) then
[q[wx].correspondent:=i;
if disk2u(i) then
[i:=ivalue(q[wx].your.mbx_count);
j:=ivalue(q[wx].your.mbx_max);
if i<max_max_mbx and then ((i<j) or (q[wx].level=9))
then display(to_from_txt)
else [display(no_slots_txt); next_state:=main_menu]]
else
[display(bad_userid_txt); next_state:=main_menu]]
else
[display(bad_userid_txt); next_state:=main_menu]];
correct3: prompt_with(cor_txt);
sendmail_subject:
if agree(s) then
[prepare_header; prompt_with(enter_subject_txt)]
else
[prompt_with(file_number_txt); next_state:=sendmail_to];
enter_subject:
if s.len=0 then
[display(msg_cancelled_txt); next_state:=sendmail_cancel]
else
[p:=newpara(ss[22]); concat(p^.msg,': '); {Subject: }
cat(p^.msg,s); q[wx].msg_last^.link:=p; q[wx].msg_last:=p;
p:=newpara(null); q[wx].msg_last^.link:=p; q[wx].msg_last:=p;
if q[wx].flag
then display(enter_body_txt)
else [prompt_with(which_canned_txt); next_state:=canned1]];
enter_body1:
[q[wx].send_line_count:=1; q[wx].count:=1; prompt_with(send_line_txt)];
enter_body2:
if s[0]=chr(0) then
[if q[wx].return_state=junk2 then q[wx].index:=largest_member_number;
display(msg_cancelled_txt); next_state:=sendmail_cancel]
else
[p:=newpara(s); q[wx].msg_last^.link:=p; q[wx].msg_last:=p;
q[wx].send_line_count:=q[wx].send_line_count+1;
q[wx].count:=q[wx].count+1;
prompt_with(send_line_txt)];
enter_body3:
if s[0]=chr(0) then
[prompt_with(send_menu_txt); next_state:=sendmail_fork]
else
[p:=newpara(s); q[wx].msg_last^.link:=p; q[wx].msg_last:=p;
q[wx].send_line_count:=q[wx].send_line_count+1;
q[wx].count:=q[wx].count+1;
if q[wx].send_line_count<=msg_line_limit or else q[wx].level=9 then
[prompt_with(send_line_txt); next_state:=enter_body3]
else
[prompt_with(send_menu_txt); next_state:=sendmail_fork]];
sendmail_menu: prompt_with(send_menu_txt);
sendmail_fork:
[next_state:=sendmail_menu;
if str=null then
display(dunno_txt)
else if str[1]=mn[10][1] {?} or else eq(str,ss[40]) {HELP} then
display(send_menu_list_txt)
else if str.len=1 and then str[1]=mn[10][2] {A} then
[if q[wx].send_line_count<=msg_line_limit or else q[wx].level=9 then
[q[wx].count:=q[wx].send_line_count;
prompt_with(send_line_txt); next_state:=enter_body3]
else display(too_long_txt)]
else if str.len=1 and then str[1]=mn[10][9] {D} then
[prompt_with(delete_line_txt); next_state:=sendmail_delete1]
else if str.len=1 and then str[1]=mn[10][3] {E} then
[prompt_with(edit_which_txt); next_state:=sendmail_edit1]
else if str.len=1 and then str[1]=mn[10][4] {H} and then
q[wx].return_state<>junk2 then
[q[wx].holding:=true;
if q[wx].return_state=pubmail5
then q[wx].hold_target:=-1
else q[wx].hold_target:=q[wx].correspondent;
display(msg_held_txt); next_state:=q[wx].return_state]
else if str.len=1 and then str[1]=mn[10][5] {L} then
[prompt_with(what_line_txt); next_state:=sendmail_list]
else if str.len=1 and then str[1]=mn[10][6] {R} then
[prompt_with(replace_line_txt); next_state:=sendmail_replace1]
else if str.len=1 and then str[1]=mn[10][7] {S} then
case q[wx].return_state of
pubmail5 : [display(pub_sending_txt); next_state:=sending];
junk2 : [q[wx].index:=0; q[wx].holding:=false;
display(sending_txt); next_state:=junk2];
otherwise
[if disk2u(q[wx].correspondent) then
[display(sending_txt); next_state:=sending]
else
[q[wx].dos_err:=-2; {corrupt members file?}
display(mail_not_sent_txt)]];
end {case}
else if str.len=1 and then str[1]=mn[10][8] {X} then
[if q[wx].return_state=junk2 then q[wx].index:=largest_member_number;
display(msg_cancelled_txt); next_state:=sendmail_cancel]
else if eq(str,ss[37]) or else eq(str,ss[38]) or else eq(str,ss[39]) then
{BYE, OFF, EXIT}
next_state:=snip
else if str.len>2 and then
str[1]=mn[7][2] {/} and then str[2]=mn[7][4] {P} then {/P}
SlashP(s,str)
else
[prompt_with(send_menu_txt); next_state:=sendmail_fork]];
sendmail_list:
if s=null or else number_query(s,1,q[wx].send_line_count-1,i) then
[if s=null then i:=1;
p:=q[wx].msg_first; q[wx].count:=i;
for j:=1 to i+4 do
if p=nill then [q[wx].count:=0; break] else p:=p^.link;
q[wx].msg_ptr:=p; display(sendmail_line_txt)]
else
[display(bad_line_number_txt); next_state:=sendmail_menu];
sendmail_list2:
[if q[wx].msg_ptr<>nill then q[wx].msg_ptr:=q[wx].msg_ptr^.link;
if q[wx].msg_ptr=nill then
[prompt_with(send_menu_txt); next_state:=sendmail_fork]
else
[q[wx].count:=q[wx].count+1;
display(sendmail_line_txt); next_state:=sendmail_list2]];
sendmail_edit1:
if number_query(s,1,q[wx].send_line_count-1,i) then
[p:=q[wx].msg_first; q[wx].count:=i;
for j:=1 to i+4 do
if p=nill then [q[wx].count:=0; break] else p:=p^.link;
q[wx].msg_ptr:=p; display(sendmail_line_txt)]
else
[display(bad_line_number_txt); next_state:=sendmail_menu];
sendmail_edit2: prompt_with(enter_new_line_txt);
sendmail_edit3:
[kopylst(s,q[wx].msg_ptr^.msg);
prompt_with(send_menu_txt); next_state:=sendmail_fork];
sendmail_replace1:
if number_query(s,1,q[wx].send_line_count-1,i) then
[p:=q[wx].msg_first; q[wx].count:=i;
for j:=1 to i+4 do
if p=nill then [q[wx].count:=0; break] else p:=p^.link;
q[wx].msg_ptr:=p; display(sendmail_line_txt)]
else
[display(bad_line_number_txt); next_state:=sendmail_menu];
sendmail_replace2: prompt_with(text_old_txt);
sendmail_replace3:
[if q[wx].verify_data=nill
then q[wx].verify_data:=newpara(s)
else kopylst(s,q[wx].verify_data^.msg);
prompt_with(text_new_txt)];
sendmail_replace4: {msg_ptr = original text, verify_data = old, s = new}
[if q[wx].msg_ptr<>nill and then q[wx].verify_data<>nill then
[k:=0;
fo